from MyTelloLib.TelloKeyboard import TellKeyboard
from MyTelloLib.MyTello import MyTello
import time

tello = MyTello('192.168.10.2')
telloKeyboard = TellKeyboard(tello)
telloKeyboard.speed = 50
telloKeyboard.speed2 = 30
tello.flight.motor_on()

while True:
    frame = tello.get_video_frame()
    if frame is not None:
        frame = telloKeyboard.write_hud(frame)
        if telloKeyboard.keyController(frame):
            break

tello.flight.motor_off()
tello.quit()
del telloKeyboard
del tello
